import request from '../utils/request'
/**
 * 账号登录
 * @params {String} account -用户名
 * @params {String} password -密码
 * @returns Promise
 */
export const UserData = ({account,password}) => {
    return request('/login','post',{account,password})
}
/**
 * 短信验证码登录
 * @params {Number} code -验证码
 * @returns Promise
 */
export const UserCodeData = (mobile) => {
    return request('/login/code','get',{mobile})
}
/**
 * 手机号登录
 * @params {Number}  mobile - 手机号
 * @params {Number}  code - 验证码
 * @returns Promise
 */
export const UserMobile = ({mobile,code}) => {
    return request('/login/code','get',{mobile,code})
}
/**
 * 扣扣登录
 * @params {Number}  unionId - 扣扣的ID
 * @params {Number}  source
 * @returns Promise
 */
export const UserQData = (unionId,source=1) => {
    return request('/login/social','post',{unionId,source})
}
/**
 * 扣扣手机号获取验证码
 * @params {Number}  mobile -绑定的手机号
 * @returns Promise
 */
export const UserQMobileData = (mobile) => {
    return request('/login/social/code','get',{mobile})
}
/**
 * 扣扣手机号验证码完整登录
 * @params {Number}  mobile -绑定的手机号
 * @returns Promise
 */
export const UserMobileCode = (unionId, mobile, code) => {
    return request('/login/social/bind','post',{unionId, mobile, code})
}